package icegps.com.pingdj.view;


import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.TextView;

import icegps.com.pingdj.utils.UnitUtils;

/**
 * Created by 111 on 2018/3/23.
 */

public class ValueTextView extends android.support.v7.widget.AppCompatTextView {
    public ValueTextView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public void setText(int unitType, int unitIndex, double value, int accuracy) {
        setText(UnitUtils.conversion(unitType, unitIndex, value, accuracy));
    }

    public void setText(int unitType, int unitIndex, double value) {
        setText(UnitUtils.conversion(unitType, unitIndex, value, 3));
    }
}
